/* sow.t  SALES ORDER WRITE TRIGGER                                   */
/*Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                 */
/*All rights reserved worldwide.  This is an unpublished work.        */
/*V8:ConvertMode=NoConvert*/
/*********************************************************************/
/*  Program :sow.t                                                   */
/*  Author  :Ben Holmes                                              */
/*  Date    :03/19/95                                                */
/*  !Description : so_mstr WRITE trigger program                     */
/*          : In order to enhance this trigger to support additional */
/*          : interfaces, add a DO-END block similar to the one      */
/*          : used for the Warehousing Interface to (1) check for the*/
/*          : need to continue processing; (2) move the relevant     */
/*          : fields to an appropriate work area; and (3) call       */
/*          : one or more subprograms to continue processing.        */
/*          : This .t program should remain short, relying on        */
/*          : subprograms to perform most of the work.               */
/*********************************************************************/
/*                             MODIFY LOG                            */
/*********************************************************************/
/*Revision 8.5          Last Modified:  12/04/95 BY: BHolmes *J0FY*  */
/*Revision 8.5          Last Modified:  07/21/96 BY: fwy     *J0MB*  */
/*Revision 8.5          Last Modified:  07/22/96 BY: GWM     *J10D*  */
/*Revision 8.5          Last Modified:  07/27/96 BY: fwy     *J12B*  */
/*Revision 8.5          Last Modified:  01/07/97 BY: jpm     *J1DM*  */
/*Revision 9.1          Last Modified:  08/12/00 BY: *N0KN* myb       */
/*                                                                   */
/*                                                                   */
/*                                                                   */
/*********************************************************************/

TRIGGER PROCEDURE FOR WRITE OF SO_MSTR OLD BUFFER OLD_SO_MSTR.

/*J12B  if not can-find(first whl_mstr where whl_mstr.whl_act no-lock) */
/*J12B  then leave. */

    {mfdeclre.i }
    define new shared work-table wf_old_so_mstr like so_mstr.
    define new shared variable w-recid as recid.
    define new shared variable w-site-loc-id like whl_mstr.whl_src_dest_id.

    define variable w-file as character format "x(24)".


    /* Warehousing Interface processing */

    WI:
    do:

    /* If there is no active external warehouse that is flagged to
    receive sales order export transactions, then do not process */
/*J12B*/    if not can-find(first whl_mstr no-lock
/*J12B*/        where whl_mstr.whl_act and whl_mstr.whl_so_exp)
/*J12B*/    then leave WI.

    /* Do not process if multi-DB and not in central database */
/*J0MB*/if global_db ne "" and global_db ne sdbname(1) then leave WI.

    /* If no pertinent fields have been changed, then do not process */
/*J12B*/    if   (old_so_mstr.so_nbr      = so_mstr.so_nbr
/*J12B*/      and old_so_mstr.so_ord_date = so_mstr.so_ord_date
/*J12B*/      and old_so_mstr.so_due_date = so_mstr.so_due_date
/*J12B*/      and old_so_mstr.so_req_date = so_mstr.so_req_date
/*J12B*/      and old_so_mstr.so_rmks     = so_mstr.so_rmks
/*J12B*/      and old_so_mstr.so_fr_list  = so_mstr.so_fr_list
/*J12B*/      and old_so_mstr.so_shipvia  = so_mstr.so_shipvia
/*J12B*/      and old_so_mstr.so_ship     = so_mstr.so_ship
/*J12B*/      and old_so_mstr.so_stat     = so_mstr.so_stat
/*J12B*/      and old_so_mstr.so_sched    = so_mstr.so_sched
/*J12B*/      and old_so_mstr.so_user1    = so_mstr.so_user1
/*J12B*/      and old_so_mstr.so_user2    = so_mstr.so_user2
/*J12B*/      and old_so_mstr.so_po       = so_mstr.so_po
/*J12B*/      and old_so_mstr.so_cmtindx  = so_mstr.so_cmtindx)
/*J12B*/    then leave WI.

    /* Move so_mstr fields to work table for subsequent processing */
       assign w-recid = recid(so_mstr).
       create wf_old_so_mstr.
       if recid(wf_old_so_mstr)= -1 then .
       assign
           wf_old_so_mstr.so_nbr       = old_so_mstr.so_nbr
           wf_old_so_mstr.so_ord_date  = old_so_mstr.so_ord_date
           wf_old_so_mstr.so_due_date  = old_so_mstr.so_due_date
           wf_old_so_mstr.so_req_date  = old_so_mstr.so_req_date
           wf_old_so_mstr.so_rmks      = old_so_mstr.so_rmks
           wf_old_so_mstr.so_fr_list   = old_so_mstr.so_fr_list
           wf_old_so_mstr.so_shipvia   = old_so_mstr.so_shipvia
           wf_old_so_mstr.so_ship      = old_so_mstr.so_ship
           wf_old_so_mstr.so_stat      = old_so_mstr.so_stat
           wf_old_so_mstr.so_sched     = old_so_mstr.so_sched
           wf_old_so_mstr.so_user1     = old_so_mstr.so_user1
           wf_old_so_mstr.so_user2     = old_so_mstr.so_user2
/*J10D*/       wf_old_so_mstr.so_po        = old_so_mstr.so_po
/*J12B*/       wf_old_so_mstr.so_cmtindx   = old_so_mstr.so_cmtindx
       .

    /* Call subprogram to create export transactions for warehouses */
       w-file = "wisow.p".
/*J1DM*/ /* {gprun.i ""wisow.p""} */
/*J1DM*/   {gprunmo.i &module="WI"
                      &program="wisow.p"}

/*J12B*/end. /* WI */

/* fdn 2004/10/28 Modify Record processing */
HK:
do:
    if can-find(first dt_mstr where dt_table = "so_mstr" and dt_type = "SYNC") then
        run CreateSyncFlag(input "MOD", input recid(so_mstr), input "so_mstr").

    if not can-find ( first dt_mstr where dt_table = "so_mstr" and dt_type = "MOD" ) then leave HK.
    
    if not can-find ( first wf_old_so_mstr ) then do:
        create wf_old_so_mstr.
        if recid(wf_old_so_mstr)= -1 then .
    end.
    
    buffer-copy old_so_mstr to wf_old_so_mstr no-error.

    for each dt_mstr no-lock where dt_table = "so_mstr" and dt_type = "MOD" :
    
        case dt_field :

            when "so_nbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_nbr, input so_mstr.so_nbr,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cust" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_cust, input so_mstr.so_cust,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ship" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ship, input so_mstr.so_ship,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ord_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ord_date), input string(so_mstr.so_ord_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_req_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_req_date), input string(so_mstr.so_req_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_due_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_due_date), input string(so_mstr.so_due_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_rmks" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_rmks, input so_mstr.so_rmks,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cr_terms" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_cr_terms, input so_mstr.so_cr_terms,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fob" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fob, input so_mstr.so_fob,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_po" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_po, input so_mstr.so_po,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_shipvia" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_shipvia, input so_mstr.so_shipvia,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_partial" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_partial), input string(so_mstr.so_partial),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_print_so" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_print_so), input string(so_mstr.so_print_so),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_inv_nbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_inv_nbr, input so_mstr.so_inv_nbr,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_pr_list" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_pr_list, input so_mstr.so_pr_list,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_xslspsn[1]" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_xslspsn[1], input so_mstr.so_xslspsn[1],
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_source" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_source, input so_mstr.so_source,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_xcomm_pct[1]" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_xcomm_pct[1]), input string(so_mstr.so_xcomm_pct[1]),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cr_card" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_cr_card, input so_mstr.so_cr_card,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_print_pl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_print_pl), input string(so_mstr.so_print_pl),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cr_init" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_cr_init, input so_mstr.so_cr_init,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_stat" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_stat, input so_mstr.so_stat,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qad01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qad01), input string(so_mstr.so__qad01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qad02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qad02), input string(so_mstr.so__qad02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qad03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qad03), input string(so_mstr.so__qad03),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_disc_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_disc_pct), input string(so_mstr.so_disc_pct),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_tax_pct[1]" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_tax_pct[1]), input string(so_mstr.so_tax_pct[1]),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_prepaid" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_prepaid), input string(so_mstr.so_prepaid),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_to_inv" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_to_inv), input string(so_mstr.so_to_inv),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_invoiced" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_invoiced), input string(so_mstr.so_invoiced),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ar_acct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ar_acct, input so_mstr.so_ar_acct,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ar_cc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ar_cc, input so_mstr.so_ar_cc,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_inv_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_inv_date), input string(so_mstr.so_inv_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ship_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ship_date), input string(so_mstr.so_ship_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_taxable" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_taxable), input string(so_mstr.so_taxable),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cmtindx" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_cmtindx), input string(so_mstr.so_cmtindx),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qad04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qad04), input string(so_mstr.so__qad04),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_user1" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_user1, input so_mstr.so_user1,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_user2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_user2, input so_mstr.so_user2,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_curr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_curr, input so_mstr.so_curr,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ex_rate" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ex_rate), input string(so_mstr.so_ex_rate),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_lang" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_lang, input so_mstr.so_lang,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_type, input so_mstr.so_type,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_conf_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_conf_date), input string(so_mstr.so_conf_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_rev" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_rev), input string(so_mstr.so_rev),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_bol" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_bol, input so_mstr.so_bol,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qad05[1]" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qad05[1]), input string(so_mstr.so__qad05[1]),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_pst" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_pst), input string(so_mstr.so_pst),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fst_id" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fst_id, input so_mstr.so_fst_id,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_trl1_amt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_trl1_amt), input string(so_mstr.so_trl1_amt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_trl1_cd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_trl1_cd, input so_mstr.so_trl1_cd,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_trl2_amt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_trl2_amt), input string(so_mstr.so_trl2_amt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_trl2_cd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_trl2_cd, input so_mstr.so_trl2_cd,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_trl3_amt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_trl3_amt), input string(so_mstr.so_trl3_amt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_trl3_cd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_trl3_cd, input so_mstr.so_trl3_cd,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_weight" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_weight), input string(so_mstr.so_weight),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_weight_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_weight_um, input so_mstr.so_weight_um,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_size" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_size), input string(so_mstr.so_size),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_size_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_size_um, input so_mstr.so_size_um,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cartons" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_cartons), input string(so_mstr.so_cartons),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_site" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_site, input so_mstr.so_site,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_pst_id" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_pst_id, input so_mstr.so_pst_id,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cncl_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_cncl_date), input string(so_mstr.so_cncl_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_quote" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_quote, input so_mstr.so_quote,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_taxc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_taxc, input so_mstr.so_taxc,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr01, input so_mstr.so__chr01,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr02, input so_mstr.so__chr02,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr03, input so_mstr.so__chr03,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr04, input so_mstr.so__chr04,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr05, input so_mstr.so__chr05,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr06" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr06, input so_mstr.so__chr06,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr07" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr07, input so_mstr.so__chr07,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr08" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr08, input so_mstr.so__chr08,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr09" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr09, input so_mstr.so__chr09,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__chr10" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__chr10, input so_mstr.so__chr10,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__dte01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__dte01), input string(so_mstr.so__dte01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__dte02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__dte02), input string(so_mstr.so__dte02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__dec01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__dec01), input string(so_mstr.so__dec01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__dec02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__dec02), input string(so_mstr.so__dec02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__log01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__log01), input string(so_mstr.so__log01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_credit" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_credit), input string(so_mstr.so_credit),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_inv_cr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_inv_cr, input so_mstr.so_inv_cr,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_project" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_project, input so_mstr.so_project,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_channel" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_channel, input so_mstr.so_channel,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_pst_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_pst_pct), input string(so_mstr.so_pst_pct),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fr_list" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fr_list, input so_mstr.so_fr_list,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fr_terms" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fr_terms, input so_mstr.so_fr_terms,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_slspsn[1]" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_slspsn[1], input so_mstr.so_slspsn[1],
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_comm_pct[1]" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_comm_pct[1]), input string(so_mstr.so_comm_pct[1]),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_inv_mthd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_inv_mthd, input so_mstr.so_inv_mthd,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fix_rate" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_fix_rate), input string(so_mstr.so_fix_rate),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ent_ex" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ent_ex), input string(so_mstr.so_ent_ex),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_bill" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_bill, input so_mstr.so_bill,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_print_bl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_print_bl), input string(so_mstr.so_print_bl),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_tax_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_tax_date), input string(so_mstr.so_tax_date),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsm_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsm_type, input so_mstr.so_fsm_type,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_userid" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_userid, input so_mstr.so_userid,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_conrep" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_conrep, input so_mstr.so_conrep,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_bank" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_bank, input so_mstr.so_bank,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_tax_env" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_tax_env, input so_mstr.so_tax_env,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_sched" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_sched), input string(so_mstr.so_sched),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fr_min_wt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_fr_min_wt), input string(so_mstr.so_fr_min_wt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_pr_list2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_pr_list2, input so_mstr.so_pr_list2,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_tax_usage" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_tax_usage, input so_mstr.so_tax_usage,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_sa_nbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_sa_nbr, input so_mstr.so_sa_nbr,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fix_pr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_fix_pr), input string(so_mstr.so_fix_pr),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_sch_mthd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_sch_mthd, input so_mstr.so_sch_mthd,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_eng_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_eng_code, input so_mstr.so_eng_code,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ship_eng" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ship_eng), input string(so_mstr.so_ship_eng),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_pricing_dt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_pricing_dt), input string(so_mstr.so_pricing_dt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_priced_dt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_priced_dt), input string(so_mstr.so_priced_dt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ca_nbr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ca_nbr, input so_mstr.so_ca_nbr,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fcg_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fcg_code, input so_mstr.so_fcg_code,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_crprlist" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_crprlist, input so_mstr.so_crprlist,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadc01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__qadc01, input so_mstr.so__qadc01,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadc02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__qadc02, input so_mstr.so__qadc02,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadc03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__qadc03, input so_mstr.so__qadc03,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadc04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__qadc04, input so_mstr.so__qadc04,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadc05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so__qadc05, input so_mstr.so__qadc05,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadl01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadl01), input string(so_mstr.so__qadl01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadl02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadl02), input string(so_mstr.so__qadl02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_incl_iss" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_incl_iss), input string(so_mstr.so_incl_iss),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadi01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadi01), input string(so_mstr.so__qadi01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadi02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadi02), input string(so_mstr.so__qadi02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadi03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadi03), input string(so_mstr.so__qadi03),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadd01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadd01), input string(so_mstr.so__qadd01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadd02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadd02), input string(so_mstr.so__qadd02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadd03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadd03), input string(so_mstr.so__qadd03),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadt01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadt01), input string(so_mstr.so__qadt01),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadt02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadt02), input string(so_mstr.so__qadt02),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadt03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadt03), input string(so_mstr.so__qadt03),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_auth_days" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_auth_days), input string(so_mstr.so_auth_days),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cum_acct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_cum_acct), input string(so_mstr.so_cum_acct),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_merge_rss" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_merge_rss), input string(so_mstr.so_merge_rss),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ship_cmplt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ship_cmplt), input string(so_mstr.so_ship_cmplt),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_bump_all" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_bump_all), input string(so_mstr.so_bump_all),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_primary" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_primary), input string(so_mstr.so_primary),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_cust_po" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_cust_po, input so_mstr.so_cust_po,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_secondary" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_secondary), input string(so_mstr.so_secondary),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ship_po" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ship_po, input so_mstr.so_ship_po,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ex_rate2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_ex_rate2), input string(so_mstr.so_ex_rate2),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ex_ratetype" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ex_ratetype, input so_mstr.so_ex_ratetype,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_div" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_div, input so_mstr.so_div,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_exru_seq" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_exru_seq), input string(so_mstr.so_exru_seq),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_app_owner" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_app_owner, input so_mstr.so_app_owner,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_ar_sub" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_ar_sub, input so_mstr.so_ar_sub,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_seq_order" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_seq_order), input string(so_mstr.so_seq_order),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_inc_in_rss" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_inc_in_rss), input string(so_mstr.so_inc_in_rss),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_firm_seq_days" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_firm_seq_days), input string(so_mstr.so_firm_seq_days),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_prep_tax" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_prep_tax), input string(so_mstr.so_prep_tax),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so__qadl04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so__qadl04), input string(so_mstr.so__qadl04),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_custref_val" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_custref_val), input string(so_mstr.so_custref_val),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_consignment" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_consignment), input string(so_mstr.so_consignment),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_max_aging_days" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_max_aging_days), input string(so_mstr.so_max_aging_days),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_consign_loc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_consign_loc, input so_mstr.so_consign_loc,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_intrans_loc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_intrans_loc, input so_mstr.so_intrans_loc,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_auto_replenish" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_auto_replenish), input string(so_mstr.so_auto_replenish),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_revenue" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_revenue, input so_mstr.so_revenue,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsaccr_acct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsaccr_acct, input so_mstr.so_fsaccr_acct,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsaccr_sub" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsaccr_sub, input so_mstr.so_fsaccr_sub,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsaccr_cc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsaccr_cc, input so_mstr.so_fsaccr_cc,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsdef_acct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsdef_acct, input so_mstr.so_fsdef_acct,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsdef_sub" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsdef_sub, input so_mstr.so_fsdef_sub,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_fsdef_cc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_so_mstr.so_fsdef_cc, input so_mstr.so_fsdef_cc,
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

            when "so_manual_fr_terms" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_so_mstr.so_manual_fr_terms), input string(so_mstr.so_manual_fr_terms),
                    input recid(so_mstr), input so_mstr.so_nbr, input "", input "", input "",
                    input "", input "", input "", input "").

        end.

    end.
end.

{hkdttrans.i}
